5 research outputs found
Enforcing Termination of Interprocedural Analysis
Interprocedural analysis by means of partial tabulation of summary functions
may not terminate when the same procedure is analyzed for infinitely many
abstract calling contexts or when the abstract domain has infinite strictly
ascending chains. As a remedy, we present a novel local solver for general
abstract equation systems, be they monotonic or not, and prove that this solver
fails to terminate only when infinitely many variables are encountered. We
clarify in which sense the computed results are sound. Moreover, we show that
interprocedural analysis performed by this novel local solver, is guaranteed to
terminate for all non-recursive programs --- irrespective of whether the
complete lattice is infinite or has infinite strictly ascending or descending
chains
Exploiting Term Hiding to Reduce Run-time Checking Overhead
One of the most attractive features of untyped languages is the flexibility
in term creation and manipulation. However, with such power comes the
responsibility of ensuring the correctness of these operations. A solution is
adding run-time checks to the program via assertions, but this can introduce
overheads that are in many cases impractical. While static analysis can greatly
reduce such overheads, the gains depend strongly on the quality of the
information inferred. Reusable libraries, i.e., library modules that are
pre-compiled independently of the client, pose special challenges in this
context. We propose a technique which takes advantage of module systems which
can hide a selected set of functor symbols to significantly enrich the shape
information that can be inferred for reusable libraries, as well as an improved
run-time checking approach that leverages the proposed mechanisms to achieve
large reductions in overhead, closer to those of static languages, even in the
reusable-library context. While the approach is general and system-independent,
we present it for concreteness in the context of the Ciao assertion language
and combined static/dynamic checking framework. Our method maintains the full
expressiveness of the assertion language in this context. In contrast to other
approaches it does not introduce the need to switch the language to a (static)
type system, which is known to change the semantics in languages like Prolog.
We also study the approach experimentally and evaluate the overhead reduction
achieved in the run-time checks.Comment: 26 pages, 10 figures, 2 tables; an extension of the paper version
accepted to PADL'18 (includes proofs, extra figures and examples omitted due
to space reasons
Inferring Parametric Energy Consumption Functions at Different Software Levels:ISA vs. LLVM IR
The static estimation of the energy consumed by program executions is an
important challenge, which has applications in program optimization and
verification, and is instrumental in energy-aware software development. Our
objective is to estimate such energy consumption in the form of functions on
the input data sizes of programs. We have developed a tool for experimentation
with static analysis which infers such energy functions at two levels, the
instruction set architecture (ISA) and the intermediate code (LLVM IR) levels,
and reflects it upwards to the higher source code level. This required the
development of a translation from LLVM IR to an intermediate representation and
its integration with existing components, a translation from ISA to the same
representation, a resource analyzer, an ISA-level energy model, and a mapping
from this model to LLVM IR. The approach has been applied to programs written
in the XC language running on XCore architectures, but is general enough to be
applied to other languages. Experimental results show that our LLVM IR level
analysis is reasonably accurate (less than 6.4% average error vs. hardware
measurements) and more powerful than analysis at the ISA level. This paper
provides insights into the trade-off of precision versus analyzability at these
levels.Comment: 22 pages, 4 figures, 2 table
Pre-indexed terms for Prolog
Indexing of terms and clauses is a well-known technique used
in Prolog implementations (as well as automated theorem provers) to
speed up search. In this paper we show how the same mechanism can be
used to implement efficient reversible mappings between different term
representations, which we call pre-indexings. Based on user-provided
term descriptions, these mappings allow us to use more efficient data
encodings internally, such as prefix trees. We show that for some classes
of programs, we can drastically improve the efficiency by applying such
mappings at selected program points